package com.aboat.action;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;

/**
 * 加载配置
 *
 * @author aboat
 * @email clear_windy@yeah.net
 * @create 2017-04-09 11:37
 */
public class LoadListener implements ActionListener{
    @Override
    public void actionPerformed(ActionEvent e) {
        JFileChooser fileChooser = new JFileChooser();
        fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
        fileChooser.setDialogTitle("加载爬虫配置文件");
        int result = fileChooser.showOpenDialog(new JPanel());
        if(result == JFileChooser.APPROVE_OPTION){
            File file = fileChooser.getSelectedFile();
            String filePath  = file.getAbsolutePath();

        }
    }
}
